<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
	<head>
		<title>订单管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
	</head>
<%@ include file="/comm.jsp"%>
	<style type="text/css">
<!--
fieldset {
	padding: 10px;
	margin: 10px;
	width: 700px;
	color: #333;
}

legend {
	color: #06c;
	font-weight: 800;
	background: #fff;
}

.menubar {
	width: 100px;
	cursor: hand;
}
-->
</style>
	<body>
		<%@ include file="/messages.jsp"%>
		<s:form name="formpage" action="order_getAllOrder" namespace="/">
			<div>
				<s:token></s:token>
				<table width="100%" class="tb_input" border="0" cellpadding="0"
					cellspacing="1">
					<tr>
						<td class="td_title">
							订单号：
						</td>
						<td>
							<input type="text" size="16" maxlength="17" id="txtOrderId"
								name="orderInfoDto.orderId" value="${orderInfoDto.orderId }"/>
						</td>
						<td class="td_title">
							状态：
						</td>
						<td>
							<s:select
								list="#{'':'--全部--','A00':'未审核','A01':'审核通过','A02':'审核不通过','A03':'未生成完','A04':'生成完成','A05':'已取消','A06':'已发货'}"
								name="orderInfoDto.status" value="#request.orderInfoDto.status"
								id="statusId" cssStyle="width:100px">
							</s:select>
						</td>
					</tr>
					<tr>
						<td class="td_title">
							开始日期：
						</td>
						<td>
							<input type="text" id="beginDate" name="orderInfoDto.beginDate"
								value='<s:date name="#request.rderInfoDto.beginDate" format="yyyy-MM-dd" />'
								size="15"
								onfocus="WdatePicker({isShowWeek:true,errDealMode:1,readOnly:true})"
								style="WIDTH: 120px; border: #999 1px solid; height: 20px; background: #fff url(<%=request.getContextPath()%>/js/My97DatePicker/skin/datePicker.gif ) no-repeat right;" />
						</td>
						<td class="td_title">
							结束日期：
						</td>
						<td>
							<input type="text" id="endDate" name="orderInfoDto.endDate"
								value='<s:date name="#request.orderInfoDto.endDate" format="yyyy-MM-dd" />'
								size="15"
								onfocus="WdatePicker({isShowWeek:true,errDealMode:1,readOnly:true})"
								style="WIDTH: 120px; border: #999 1px solid; height: 20px; background: #fff url(<%=request.getContextPath()%>/js/My97DatePicker/skin/datePicker.gif ) no-repeat right;" />
						</td>
					</tr>
					<tr>
						<td class="td_title">
							公司代码:
						</td>
						<td>
							<input type="text" size="16" maxlength="17" id="txtCompanyId"
								name="orderInfoDto.companyId" value="${orderInfoDto.companyId }"/>
						</td>
						
						<td colspan="2" align="center">
							<input type="submit" id="ok" name="Submit" class="button"
								value="查询"  />
							&nbsp;&nbsp;
							<input name="Submit2" type="button" class="button" value="清空"
								onClick="javascript:clearAll();">
							&nbsp;&nbsp;
						</td>
					</tr>
				</table>

				<table align="center" width="100%" class="tb_datalist">
					<tr class="tr_title">
						<td>
							订单号
						</td>
						<td>
							订单日期
						</td>
						<td>
							产品名称
						</td>
						<td>
							型号
						</td>
						<td>
							客户名称
						</td>
						<td>
							订购数量
						</td>
						<td>
							订单状态
						</td>
						<td>
							操作
						</td>
					</tr>
					<s:iterator value="#request.orderList" id="ca">
						<tr
							onMouseOver="javascript:this.className='tr_selected';"
							onMouseOut="javascript:this.className='tr_even';">
							<td>
								<a
									href="<s:url action="order_viewPage">
									<s:param name="orderId"><s:property value="#ca.id"/></s:param>
									</s:url>">
									<s:property value="#ca.id" />
								</a>
							</td>
							<td>
								<a
									href="<s:url action="order_viewOrderValid">
									<s:param name="orderId"><s:property value="#ca.id"/></s:param>
									</s:url>">
								<s:date name="#ca.createDate" format="yyyy-MM-dd HH:mm"/>	
								</a>
							</td>
							<td>
								<s:property value="#ca.productName" />
							</td>
							<td>
								<s:property value="#ca.type" />
							</td>
							<td>
								<s:property value="#ca.companyName" />
								(<s:property value="#ca.companyId" />)
							</td>
							<td align="right">
								<s:property value="#ca.amount" />
							</td>
							<td align="center">
								<s:property value="showStatus(#ca.status)" />
							</td>
							<td align="center">
							
							<s:if test='"A01"== #ca.status || "A02"== #ca.status'>
								<a href="<s:url action="order_unAuditOrder"><s:param name="orderId"><s:property value="#ca.id"/></s:param></s:url>">
									反审核
								</a>
							</s:if>
							
							<!-- 封条生成后客户将不能再取消订单 -->
							<a
								href="<s:url action="order_viewPage">
								<s:param name="orderId"><s:property value="#ca.id"/></s:param>
								</s:url>">
								<!-- 审核 生成封条 确认发货 -->
								<s:property value="showOperStr(#ca.status,#ca.sid)" />
							</a>
							
							<s:if test='"A03"== #ca.status || "A04"== #ca.status'>
							<a href="<s:url action="order_delSeal"><s:param name="orderId"><s:property value="#ca.id"/></s:param></s:url>">
									删除数据
								</a>
							</s:if>
							
							<s:if test='"A04"== #ca.status || "A06"== #ca.status'>
								<a href="<s:url action="order_exportToExcel"><s:param name="orderId"><s:property value="#ca.id"/></s:param></s:url>">
									导出数据
								</a>
							</s:if>
							
							</td>
						</tr>
					</s:iterator>
					<s:property value="#request.allowpage" escape="false" />
				</table>
			</div>
		</s:form>
	</body>
</html>
